<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>编辑用户信息</title>
    <link rel="stylesheet" type="text/css" th:href="@{/styles.css}">
</head>
<body>
<div class="container">
    <h2>编辑用户信息</h2>

    <div class="success-message" th:if="${param.success}">
        用户信息更新成功！
    </div>
    <div class="error-message" th:if="${param.error}">
        更新失败，请重试！
    </div>

    <form action="#" th:action="@{/user/update}" th:object="${user}" method="post">
        <input type="hidden" th:field="*{id}" />

        <div class="form-group">
            <label for="username">用户名:</label>
            <input type="text" id="username" th:field="*{username}" required />
        </div>

        <div class="form-group">
            <label for="password">密码:</label>
            <input type="password" id="password" th:field="*{password}" required />
        </div>

        <button type="submit">保存修改</button>
    </form>

    <a href="/user/manage" class="back-link">返回用户列表</a>
</div>
</body>
</html>
